package com.neo.base.advanceFunction

import scala.collection.mutable.ArrayBuffer

object MapTest {


  def judges(a: Int): Boolean = {

    val bb = a %2
    bb.equals(0)
  }

  def main(args: Array[String]): Unit = {

    val aa  = (1 to 10).map(1 * _)
    println(aa)

    val  arrbuff = new ArrayBuffer[String]
    arrbuff += "zhao"
    arrbuff += "shun"
    arrbuff += "china"

    println(arrbuff)

    val bb = arrbuff.map( "a" + _)
    println(bb)

    val cc = arrbuff.map(s => s + "aa")

    println(cc)


    val dd = (1 to 5).map(s => s % 2)

    println(dd)

    val ee = (1 to 5).map(s  => if (judges(s)) s)
    println(ee)

    val ff = (1 to 5).filter(judges)

    println(ff)

  }
}
